local ldb = LibStub("LibDataBroker-1.1")
local wLat = "|cffe1a500w|cff69ccf0Latency";
local Broker_wLatency = ldb:NewDataObject("Broker_wLatency", {
	type = "data source",
	text = "1000ms",
	value = 1000,
	suffix = "ms",
	icon = "interface\\addons\\broker_wlatency\\img\\icon.tga",
	label = "|cffe1a500w|cff69ccf0Latency",
	OnTooltipShow = function(tool)
		tool:AddLine(wLat);
	end,
})

local lastUp = 0
local OnUpdate = CreateFrame("Frame")
OnUpdate:SetScript("OnUpdate", function(self, elap)
	lastUp = lastUp + elap
	if (lastUp>15) then
		local _, _, lat = GetNetStats()
		Broker_wLatency.text = (lat.." ms")
		Broker_wLatency.value = lat
		lastUp = lastUp - 15
	end
end)